1. Field of the Invention
The present invention relates to a circuit for detection of internal microprocessor watchdog device execution and a method for resetting a microprocessor system.
2. Brief Description of the Background of the Invention Including Prior Art
A watchdog device is employed in microprocessor systems to constantly monitor if the microprocessor properly executes its programs. A properly functioning microprocessor periodically performs certain activities, for instance storing a value in a register, sending an impulse to one of its outputs, or reading data. The watchdog device monitors these activities and if they do not occur in a specific period of time, it restarts the microprocessor to restore the proper execution of microprocessor program.
In the existing systems, the watchdog device is built into the internal structure of the microprocessor, or constitutes a separate external circuit. Taking into account its functionality, the watchdog device, on its activation, may restart the microprocessor or the whole system. In case of a restart of the microprocessor itself, the restart of the whole system must be executed by the microprocessor. Some of the microprocessors having an internal watchdog device are provided with an output pin that provides information about activation of the watchdog device. Such information may be used for a restart of the whole system.
In a typical system, the clock impulse generator sends signals to the microprocessor, to the watchdog device and to other circuits of the system. In case where the watchdog device is in a form of a clock impulse counter, it sends a microprocessor a start or a reset signal after having counted a certain amount of impulses. Under normal operating conditions, the microprocessor sends a signal to the watchdog device to avoid a reset. This signal causes the watchdog to restart impulse counting. Therefore, during normal microprocessor operation the watchdog device is periodically reset. When the microprocessor operation is disrupted, the signal resetting the watchdog device will not be sent early enough and the microprocessor will be reset.
A common problem occurs while writing data to a Flash-type memory, in which the program executed by the processor is stored, when it is necessary to control the access to this memory and set it to write or read mode. For a proper operation of the system, both the write and read operations must be performed without disruptions. If any disruption in microprocessor operation occurs and the microprocessor is reset by the watchdog device, it is necessary to reset the Flash-type memory as well. This requires a reset of the whole system.
One of the known solutions to avoid the problem of access to the Flash memory is presented in the U.S. Pat. No. 5,983,330 entitled “Microcomputer with Watchdog Timer Setting Suppressing Interrupt Request Processing Over Memory Data Write Operation to Flash Memory”. That solution suggests disconnecting the watchdog device from the microprocessor while writing data to the Flash memory. However, this is not an ideal solution. It requires controlling the output signal of the watchdog device. Moreover, disconnecting the watchdog device increases the probability of system crash.
Another solution is presented in a European Patent Office patent application no. EP 0 945 770 A2 entitled “Electronic control unit and method having program rewriting function”. It describes method for controlling a system while writing data to a Flash memory. The drawback of this method is that the processor should signal its abnormal operation.